<template>
    <div class="vbus-son2">
        <el-button @click="sendMsg" style="marginTop: 10px;">点击触发Son1组件的自定义事件，并发送数据</el-button>
        <el-button @click="unbind" style="marginTop: 10px;">点击解绑receive-msg自定义事件</el-button>
    </div>
</template>

<script>
export default {
    name: 'VbusSon2',
    methods: {
        sendMsg() {
            this.$bus.$emit('receive-msg', '这是son2给son1发送的数据');
        },
        unbind() {
            this.$bus.$off('receive-msg');
        }
    }
}
</script>

<style>

</style>